package com.narunas {
	
	import com.narunas.controller.AddressChangeCommand;
	import com.narunas.controller.StartCommand;
	import com.narunas.controller.TitleChangeCommand;
	import com.narunas.controller.layoutCommands.*;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;

	public class ApplicationFacade extends Facade implements IFacade{
		
		public static var BASE_PATH: String 			= "/";
		
		
		// the basic commands and notification events
		public static const START:String 				= "start";
		// PREP
		public static const PREP_SWFADDRESS:String			= "prep_swf_address";
		public static const PREP_FLASHVARS:String			= "prep_flashvars";
		public static const PREP_BUSINESS_COM_LAYER:String	= "prep_business_com_layer";
		public static const PREP_PRELOADER: String			= "prep_preloader";
		
		// PREP ESSENTIALS
		public static const PREP_COMMON_ASSETS:String		= "prep_common_assets";		
		public static const PREP_NAVIGATION:String			= "prep_navigation";
		
		
		//prep TIER 1
		public static const PREP_VIEW_TIER_ONE: String 		= "prep_view_tier_one";
		
		
		
		
		// MAIN navigation
		public static const NAV_CHANGE: String 				= "nav_change";
		public static const NAV_UPDATE: String				= "nav_update";
		
		
		
		//INITIALIZING
		public static const INIT_HOME_PAGE: String		= "init_home_page";
		
		
		
		// resizing 
		public static const ADD_TO_RESIZER:String 		= "add_to_resizer";
		public static const RESIZE_STAGE:String 		= "resize_stage";
		public static const REMOVE_FROM_RESIZE:String 	= "remove_from_resizer";
		public static const FORCE_RESIZE:String			= "force_resize";
		
		
		/* VIEWS */
		public static const INIT_NAVIGATION:String  	= "init_navigation_component";
		public static const INIT_FOOTER:String  		= "init_footer_component";

		
		
		*/
		public static const PAGE_ERROR:String = "page_error";
		
		
		
		public static var instance:ApplicationFacade;
		
		public static function getInstance():ApplicationFacade {
			if (instance == null) {
				instance = new ApplicationFacade();
			}
			return instance;
		}
		
		override protected function initializeController():void{
			
			super.initializeController();
			
			// initializing the site
			registerCommand(ApplicationFacade.START, StartCommand);
			
			
			
			
			
			registerCommand(ApplicationFacade.ADDRESS_CHANGE, AddressChangeCommand);
			registerCommand(ApplicationFacade.TITLE_CHANGE, TitleChangeCommand);
			
			// resizing commands - these will be used to position view elements
			registerCommand(ApplicationFacade.RESIZE_STAGE, ResizeStageCommand);
			registerCommand(ApplicationFacade.ADD_TO_RESIZER, AddToResizerCommand);
			registerCommand(ApplicationFacade.FORCE_RESIZE, ForceStageResizeCommand);
			registerCommand(ApplicationFacade.REMOVE_FROM_RESIZE, RemoveFromResizerCommand);
			
			
			//
			// more to come
			// 
		}
		
	}
	
}
